/*
============================================================================
Name        : eStockApplication.cpp
Author      : 王斌
Version     :
Copyright   : 益盟软件
Description : Main application class
============================================================================
*/

// INCLUDE FILES
#include "eStockDocument.h"
#include "eStockApplication.h"
#include "Logger.h"
#ifdef __SERIES60_3X__
#include <eikstart.h>
#endif
// ============================ MEMBER FUNCTIONS ===============================

// UID for the application;
// this should correspond to the uid defined in the mmp file

#ifdef __SERIES60_3X__
const TUid KUideStockApp = {0xe8681e80};
#else
const TUid KUideStockApp = {0x001F5464};
#endif
// -----------------------------------------------------------------------------
// CeStockApplication::CreateDocumentL()
// Creates CApaDocument object
// -----------------------------------------------------------------------------
//
CApaDocument* CeStockApp::CreateDocumentL()
{
	// Create an eStock document, and return a pointer to it
	return (static_cast<CApaDocument*>( CeStockDocument::NewL( *this ) ) );
}

// -----------------------------------------------------------------------------
// CeStockApplication::AppDllUid()
// Returns application UID
// -----------------------------------------------------------------------------
//
TUid CeStockApp::AppDllUid() const
{
	// Return the UID for the eStock application
	return KUideStockApp;
}


EXPORT_C CApaApplication* NewApplication()
{
	return new CeStockApp;
}

#ifndef __SERIES60_3X__
// ---------------------------------------------------------
// E32Dll(TDllReason)
// Entry point function for EPOC Apps
// Returns: KErrNone: No error
// ---------------------------------------------------------
//
GLDEF_C TInt E32Dll( TDllReason )
{
	return KErrNone;
}

#else
// ---------------------------------------------------------
// E32Main()
// Entry point function for new (>= 9.0) EPOC Apps (exe)
// Returns: Sistem Wide error codes or KErrNone if all goes well
// ---------------------------------------------------------
//
GLDEF_C TInt E32Main()
{
	/*RHeap *heap = UserHeap::ChunkHeap(NULL, 1024 * 4, 1024 * 1024 * 4);
	if( heap )
		User::SwitchHeap( heap );
	TInt ret = EikStart::RunApplication( NewApplication );
	if ( heap )
		heap->Close();
	return ret;*/
	return EikStart::RunApplication( NewApplication );
}
#endif
// End of File
